package cn.jiyun.controller;

import cn.jiyun.dao.lesson.LessonDTO;
import cn.jiyun.feign.LessonFeign;
import cn.jiyun.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author 王晨
 * Date 2023/8/23
 */
@RestController
@RequestMapping("/lesson")
public class LessonController {
    @Autowired
    private LessonFeign lessonFeign;

    @RequestMapping("lcount")//查询当前登录人的课程数
    public R lcount(LessonDTO lessonDTO){
        return lessonFeign.findCount(lessonDTO);
    }

    @RequestMapping("newLes")
    public R newLes(){
        return lessonFeign.Newlesson();
    }
    @RequestMapping("newLes2")
    public R newLes2(){
        return lessonFeign.Newlesson2();
    }
    @RequestMapping("newLes3")
    public R newLes3(){
        return lessonFeign.Newlesson3();
    }

    @RequestMapping("findLesson")//查询所有课程
    public R findLesson(LessonDTO lessonDTO){
        return lessonFeign.findLesson(lessonDTO);
    }
    @RequestMapping("/findColor")//查询课程对应的标签
    public R findColor( Integer id){
        return lessonFeign.findColor(id);
    }
    @RequestMapping("/zuer")//最新查询
    public R zuer(LessonDTO lessonDTO){
        return lessonFeign.zuer(lessonDTO);
    }

    @RequestMapping("/findLessonLogin")//查询当前登录人学的课程
    public R findLessonLogin(LessonDTO lessonDTO){
        return lessonFeign.findLessonLogin(lessonDTO);
    }
}
